<template>
  <div class="ispay-container">
    <!-- head return-->
    <div class="payments-head">
      <van-nav-bar title="支付详情" style="background: #ededed">
        <template #left>
          <van-icon size="24" color="black" />
        </template>
      </van-nav-bar>
    </div>

    <div class="state-content">
      <div class="sucess-text">
        <div class="sucess-box">
          <van-icon name="checked" v-show="false" />
          <van-icon name="clear" v-show="true" />
          <span>下单失败</span>
        </div>
        <div class="order-info">
          <div class="order-date">
            <span>下单时间:</span>
            <span>{{ createTime }}</span>
          </div>
          <div class="order-num">
            <span>订单编号:</span>
            <span>{{ orderNo }}</span>
          </div>
        </div>
      </div>

      <div class="back-btn">
        <van-button type="primary" block @click="escPayState">点击退出当前页面</van-button>
      </div>
    </div>
  </div>
</template>

<script>
import moment from 'moment'

export default {
  name: 'isPay',
  data() {
    return {
      createTime: '',
      orderNo: ''
    }
  },
  created() {
    this.createTime = this.$moment.TZ(moment().format())
    this.orderNo = Date.parse(this.createTime)
  },
  mounted() {
    this.$msg.success('暂未开通该功能')
  },
  methods: {
    escPayState() {
      this.$router.go(-1)
    }
  }
}
</script>

<style lang="less" scoped>
.ispay-container {
  position: absolute;
  width: 100%;
  height: 100%;
  max-width: 640px;
  background-color: #ededed;
}

.van-nav-bar {
  position: fixed;
  width: 100%;
  max-width: 640px;
  z-index: 3;
}

.state-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 46px;
  background-color: #ededed;
  .sucess-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 96%;
    height: 300px;
    border-radius: 9px;
    background-color: white;
    .order-info {
      .order-date,
      .order-num {
        span:nth-child(1) {
          font-size: 0.8em;
          margin-right: 0.6em;
          color: #454545;
        }
        span:nth-child(2) {
          font-size: 0.8em;
          color: #9e9e9e;
        }
      }
    }
    .sucess-box {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 100px;
      height: 100px;
      margin-bottom: 1em;
      /deep/.van-icon-checked,
      .van-icon-clear {
        font-size: 3em;
        color: green;
        margin-bottom: 0.45em;
      }
      .van-icon-clear {
        color: red;
      }
      span:nth-child(2) {
        font-size: 1.2em;
        color: #ffbf05;
      }
    }
  }
  .back-btn {
    overflow: hidden;
    width: 96%;
    margin-top: 1em;
    border-radius: 6px;
    /deep/.van-button--primary {
      background-color: #ffbf05;
      border: none;
      font-size: 1em;
    }
  }
}
</style>
